<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="zd" value="${pageContext.request.contextPath}" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">

<link rel="stylesheet" href="${zd}/static/plug/weui/css/weui.css" media="all">
<link rel="stylesheet" href="${zd}/static/plug/weui/css/weuix.css" media="all">
<link rel="stylesheet" href="${zd}/static/css/addCarNo.css" media="all">

<title>购票页面</title>
<body>
	<div>
		
		<p>wxPayParams ： ${wxPayParams}</p>
		<p>wxPayParams.timeStamp : ${wxPayParams.timeStamp}</p>
		<p>wxPayParams.nonceStr : ${wxPayParams.nonceStr}</p>
		<p>wxPayParams.package ： ${wxPayParams.packageStr}</p>
		<p>wxPayParams.signType : ${wxPayParams.signType}</p>
		<p>wxPayParams.paySign ： ${wxPayParams.paySign}</p>
		<a id="payBtn" href="javascript:;" class="weui-btn bg-orange">立即支付</a>
	</div>
</body>
<script src="${zd}/static/js/jquery/jquery-3.2.1.min.js"></script>
<script src="${zd}/static/plug/frozenui-1.3.0/js/frozen.js"></script>
<script src="${zd}/static/js/laydate/laydate.js"></script>
<script src="${zd}/static/js/user/addCarNo.js"></script>
<script src="${zd}/static/plug/layer_mobile/layer.js"></script>
<script src="${zd}/static/js/common.js"></script>
<script src="${zd}/static/plug/weui/js/zepto.weui.js" type="text/javascript"></script>
<%-- <script src="${zd}/static/js/jweixin-1.2.0.js"></script> --%>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<script type="text/javascript">
	wx.config({
		debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		appId : "${signature.appId}", // 必填，公众号的唯一标识
		timestamp : "${signature.timestamp}", // 必填，生成签名的时间戳
		nonceStr : "${signature.nonceStr}", // 必填，生成签名的随机串
		signature : "${signature.signature}",// 必填，签名，见附录1
		jsApiList : [ 'chooseWXPay' ]
	// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
	});
	$(function() {
		wx.ready(function () {
			var timeStamp = "${wxPayParams.timeStamp}";
			var nonceStr = "${wxPayParams.nonceStr}";
			var packageStr = "${wxPayParams.packageStr}";
			var signType = "${wxPayParams.signType}";
			var paySign = "${wxPayParams.paySign}";
			$("#payBtn").click(function(){
				wx.chooseWXPay({
				     "timestamp": timeStamp, // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
				     "nonceStr": nonceStr, // 支付签名随机串，不长于 32 位
				     "package": packageStr, // 支付签名随机串，不长于 32 位
				     "signType": signType, // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
				     "paySign": paySign, // 支付签名
				     success: function (res) {
				         console.log("pay success");
				         showTips("warn", "充值成功！");
				     }
			 	});
			});
		});
	});
</script>
</html>
